//
//  CommonAddressBookContactInfo.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 16/12/29.
//  Copyright © 2016年 com.xtion.crm. All rights reserved.
//

#import "CommonAddressBookContactInfo.h"

static XMSQueueDictionary *s_jsonPair;

@implementation CommonAddressBookContactInfo

+ (void)initialize
{
    if(s_jsonPair == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"ID" value:@"contactId"];
        [qd addKey:@"DeptName" value:@"departmentName"];
        [qd addKey:@"Name" value:@"userName"];
        [qd addKey:@"Tel" value:@"tel"];
        [qd addKey:@"MoveTel" value:@"mobilePhone"];
        [qd addKey:@"QQ" value:@"qq"];
        [qd addKey:@"Email" value:@"email"];
        [qd addKey:@"Address" value:@"address"];
        [qd addKey:@"WeiXin" value:@"wecat"];
        
        s_jsonPair = [CTransformHTTPRESTObj registerJSONObjectClass:[CommonAddressBookContactInfo class] JSONKeyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair propertyWithJSONKey:JSONKeys];
}

-(NSString*)pinyinValue
{
    return [self.userName transformToPinYin];
}

-(NSString*)nameValue
{
    return self.userName;
}

@end
